﻿// ----------------------------------------------------------------------------------
// <copyright file="ContextManagerBase.cs" company="Christopher Hines">
// Copyright (c) 2012 All Right Reserved
// </copyright>
// <author>Chris Hines</author>
// <date>2012-02-27</date>
// <summary>
//     Summary goes here
// </summary>
// ----------------------------------------------------------------------------------

namespace Copperfield
{
    using System;

    /// <summary>
    /// Responsible for getting and setting an application's context
    /// </summary>
    /// <typeparam name="T">
    /// The type of the context
    /// </typeparam>
    public abstract class ContextManagerBase<T> : IContextManager where T : IComparable, new()
    {
        /// <summary>
        /// Gets the context
        /// </summary>
        IComparable IContextManager.Context
        {
            get { return this.GetContext(); }
        }

        /// <summary>
        /// Gets the current context instance
        /// </summary>
        /// <returns>
        /// The current context instance
        /// </returns>
        public abstract T GetContext();

        /// <summary>
        /// Sets the current context value
        /// </summary>
        /// <param name="context">
        /// The context value to assign
        /// </param>
        public abstract void SetContext(T context);
    }
}